const Router = require('koa-router')
const config = require('../config')
const { getServerIP } = require('../utils/index')

const socketRouter = new Router()
socketRouter.prefix('/socket')
socketRouter.get('/connect', ctx => {
  const serverIP = getServerIP()

  ctx.body = {
    code: 20000,
    data: `ws://${serverIP}:${config.socket_prot}`,
    msg: ''
  }
})

module.exports = socketRouter
